from appium.webdriver.webdriver import WebDriver
from selenium.webdriver.support.wait import WebDriverWait


class Base:
    def __init__(self,driver : WebDriver=None):
        self.driver = driver
    # find 查找封装
    def find(self,by,loc):
        return WebDriverWait(self.driver,timeout=90).until(lambda x:self.driver.find_element(by,loc))

    # click 点击封装
    def click(self,by,loc):
        return self.find(by,loc).click()

    # input 输入封装
    def input(self,by,loc,v):
        return self.find(by,loc).send_keys(v)